<?php
/**
 * Created by litong on Date: 2019/2/24 0024 下午 9:40
 */

$host="localhost";$username="root";$password="";$dbname="php_study";
$connection = new mysqli($host, $username, $password, $dbname);
if($connection->connect_error){
  echo $connection->connect_error;
}
$sql = "INSERT INTO my_guests (firstname, lastname, email)VALUES ('John', 'Doe', 'john@example.com');";
$sql .= "INSERT INTO my_guests (firstname, lastname, email)VALUES ('Mary', 'Moe', 'mary@example.com');";
$sql .= "INSERT INTO my_guests (firstname, lastname, email)VALUES ('Julie', 'Dooley', 'julie@example.com')";
if($connection->multi_query($sql)){
  echo "执行成功";
}else{
  echo $connection->error;
}

